package com.pattern.test;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.logging.Logger;

import org.junit.Test;

import com.pattern.util.TMap;
import com.pattern.util.impl.THashMap;

public class TTest2 {

	public   Logger log = Logger.getLogger(this.getClass().getName());
	@Test
	public void name() {
		TMap<String, Object> map = new THashMap<String, Object>();
		for (int index = 0; index < 100; index++) {
			map.put(index+"", System.currentTimeMillis());
		}
		
		Set<String> keySet = map.keySet();
		int i = 0;
		for (String string : keySet) {
			log.info(i+++"k------------"+string);
		}
	}
	
	@Test
	public void name1() {
		int num = 1;
		num++;
		log.info(num +"");
		num = 1;
		++num;
		log.info(num+"");
	}
	@Test
	public void name3() throws Throwable {
		MethodType type = MethodType.methodType(void.class);
        MethodHandles.Lookup lookup = MethodHandles.lookup();
        MethodHandle findVirtual = lookup.findVirtual(getClass(), "name2", type);
        findVirtual.invoke();
 	}
	public void name2() {
		 log.info("headermethod");
	}
	@Test
	public void name4() {
		List<String> list = new LinkedList<>();
		for (int index = 0; index < 100; index++) {
			list.add(index+"");
		}
		log.info("headermethod");
	}
}
